<div class="well">
    <button type="button" class="btn btn-success" onclick="buy.addGood();">Добавить
        <i class="icon-plus-sign"></i>
    </button>
    <div class="container buy-types">
        <a class="label" href="/buy/">Все</a>
        <? foreach ($this->types as $typeId => $type):?>
            <a class="label" href="/buy/?type=<?= $typeId ?>"><?= $type ?></a>
        <? endforeach;?>
    </div>
</div>
<hr>
<div class="goods-block">
    <? foreach ($this->goods as $good):?>
        <?/**@var $good Application_Model_Buy */?>

        <div class="well good" id="buy-id-<?= $good->getBuyId()?>">
            <div class="post-action">
                <? if (!$good->getBuyStatus()):?>
                    <i title="В топ" class="icon-thumbs-up" onclick="buy.onTop(<?=$good->getBuyId()?>)"></i>
                <? else:?>
                    <i title="Удалить из топа" class="icon-thumbs-down" onclick="buy.deleteFromTop(<?=$good->getBuyId()?>)"></i>
                <? endif;?>
                <i title="Редактировать" class="icon-pencil" onclick="buy.getForm(<?=$good->getBuyId()?>)"></i>
                <i title="Удалить" class="icon-trash" onclick="buy.deleteBuy(<?=$good->getBuyId()?>);"></i>
            </div>
            <h6><?= $good->getBuyName(); ?></h6>
            <p><?= $good->getBuyDescription(); ?></p>
            <hr>
            <div class="buy-type">
                <a class="label" href="/buy/?type=<?= $good->getBuyType() ?>"><?= Application_Model_Buy::getTypeById($good->getBuyType())?> </a>

            </div>
        </div>
    <? endforeach; ?>
</div>

<div class="pagination">
    <ul>
        <!-- Ссылка на предыдущую страницу -->
        <li  class="<? if (!$this->prevPage): ?>disabled<?endif;?>">
            <? if (!$this->prevPage): ?>
                <span>Назад</span>
            <? else: ?>
                <a href="<?=$this->url($this->paramsPrevPage)?>">Назад</a>
            <? endif; ?>
        </li>

        <!-- Ссылка на следующую страницу -->
        <li class="<? if (!$this->nextPage): ?>disabled<?endif;?>">
            <? if (!$this->nextPage): ?>
                <span>Вперед</span>
            <? else: ?>
                <a href="<?=$this->url($this->paramsNextPage)?>">Вперед</a>
            <? endif; ?>
        </li>
    </ul>
</div>